package com.hhkj.study.common.logic;

import com.hhkj.study.admin.order.model.req.OrderReq;
import com.ruoyi.common.utils.IdWorker;

public class OrderInfoCreator {

    public static String createCode(OrderReq orderReq) {
        Integer enterpriseFlag = orderReq.getEnterpriseFlag();
        boolean isEnt = enterpriseFlag != null && enterpriseFlag == 1;
        String orderStart = "P";
        if (isEnt){
            orderStart = "E";
        }

        IdWorker idWorker = new IdWorker(2);
        return orderStart + idWorker.nextId();
    }
}
